<php>$meta_title = "财务对账";</php>
<include file="Public:header" />
<tagLib name="html" />
<div id="main" class="main" >
<!-- 主体内容  -->
<div class="content" >
<!--  功能组区域  -->
<div class="btn-toolbar">
      <div class="btn-group">
  <button class="btn btn-primary" onclick="add()"><i class="icon-plus icon-white"></i> 新增</button>
<button class="btn btn-primary" onclick="import_order()"><i class="icon-share-alt icon-white"></i> 导入</button>
<button class="btn btn-primary" onclick="clean_order()"><i class="icon-th icon-white"></i> 清理合并订单</button>
<button class="btn btn-primary" onclick="foreverdel()"><i class="icon-trash icon-white"></i> 删除</button>
</div><!-- 查询区域 -->
<form class="search-form pull-right" method='get' action="__URL__">
	<select name="time_type" class="span1"> 
			<option value="">--选择时间--</option>
			<option value="1" <eq name="_REQUEST.time_type" value="2">selected</eq> >发货时间</option> 
			<option value="3" <eq name="_REQUEST.time_type" value="3">selected</eq> >对账时间</option> 
			<option value="2" <eq name="_REQUEST.time_type" value="4">selected</eq> >收货时间</option>
		</select>
	从<input type="text" class="span2"  name="start_time" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" value="<notempty name='_REQUEST.start_time'>{$_REQUEST.start_time}</notempty>">
		到<input type="text" class="span2" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" name="end_time" id="end_time" value="<notempty name='_REQUEST.end_time'>{$_REQUEST.end_time}</notempty>" >
	周期{:modList('Reconcile_cycle',$_REQUEST['cycle_id'],'span2','cycle_id','id desc')}
	来源{:modList('Order_source',$_REQUEST['order_source_id'], 'span1' )}
    纯订单 {:configList(C('pure_lens'),$_REQUEST['is_pure'],'is_pure' )}
	对账状态{:configList(C('reconcile_status'),$_REQUEST['mall_reconcile_status'],'mall_reconcile_status','span2')}
	原始状态<select name="mall_order_status" class="span2"> 
			<option value="">--选择状态--</option>
			<option <eq name="_REQUEST.mall_order_status" value="买家已付款，等待卖家发货">selected</eq> >买家已付款，等待卖家发货</option>
			<option <eq name="_REQUEST.mall_order_status" value="卖家已发货，等待买家确认">selected</eq> >卖家已发货，等待买家确认</option> 
			<option <eq name="_REQUEST.mall_order_status" value="交易成功">selected</eq> >交易成功</option> 
			<option <eq name="_REQUEST.mall_order_status" value="卖家部分发货">selected</eq> >卖家部分发货</option>
			<option  <eq name="_REQUEST.mall_order_status" value="交易关闭">selected</eq> >交易关闭</option>
		</select>
		<input type="text" class="search-query span2" name="keywords" <notempty name='_REQUEST.keywords'>
		<php>echo 'value="'.urldecode($_REQUEST['keywords']).'"'</php>
		<else/>
		placeholder="搜索"
	</notempty>
	>
	<input type="submit" class="btn btn-primary" value="搜索"></form>
	导出
		<a href="__URL__/export_order?{$parameters}" class="btn">订单</a>
</div>
<!-- 功能组区域结束 -->
<php>
 function editLink($id){
     echo ('<a href="__APP__/Reconcile/edit/id/'.$id.'">'.$id.'</a>');
	}

</php>

<!-- 列表显示区域  -->
<div class="list" >
<div id="result" class="result none"></div>
<div>对账总金额:{$check_total}</div>
<html:list id="checkList" style="table table-bordered table-striped" name="action" checkbox="true" action="true" datasource="list" show="id|editLink:编号,sale_no:订单号:edit,mall_no:原单号,is_pure|showYesNo:纯订单,should_pay:应收款,mall_should_pay:原始应收款,check_total:对账金额,refund:退款,mall_reconcile_status|getConfigVal=reconcile_status:原始单对账状态,cycle_id|getModelName=Reconcile_cycle:对账周期,remark:备注,shipping_time|toDate:发货时间,mall_order_status:原始状态" actionlist="edit:详情:id" />
</div>
<!--  分页显示区域 -->
<div class="page">{$page}</div>
<!-- 列表显示区域结束 -->
</div>
<!-- 主体内容结束 -->
</div>
<!-- 主页面结束 --><include file="Public:footer"/>

<load href="__PUBLIC__/Js/My97DatePicker/WdatePicker.js" />
<script type="text/javascript">
 function import_order(){
    location.href= APP+'/Reconcile/import';
 }
 function clean_order(){
    location.href= APP+'/Tools/clean_order';
 }
</script>

